<?php 
  $ft_list=$data['noveltype'];
  $hits_list=$data['novelhittimes'];
  $f_list=$data['novelinfor'];
?>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <!-- META标签分两大部分：HTTP标题信息（HTTP-EQUIV）和页面描述信息（NAME）。 -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="你网页的简述">
    <meta name="author" content="标注网页的作者或制作组">
    <link rel="icon" href="../../favicon.ico">

    <title>爱阅网_爱悦集团旗下网站</title>

    <!-- Bootstrap core CSS -->
    <link href="assets/css/bootstrap.min.css" rel="stylesheet">
    <!-- link 链接外部样式表 rel 该属性规定当前文档与被链接文档之间的关系-->
    <!-- Custom styles for this template -->
    <link href="assets/css/offcanvas.css" rel="stylesheet">
    <link href="assets/css/style.css" rel="stylesheet">
    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]>
    <script src="assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="assets/js/ie-emulation-modes-warning.js"></script>
    <!-- <script>标签 在HTML中插入一段JavaScript-->

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body><!--<nav> 标签定义导航链接的部分。-->
<nav class="navbar navbar-fixed-top navbar-inverse">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li><a href="index.php">首页<span class="sr-only">(current)</span></a></li>
        <?php 
           foreach ($f_list as $one)
           {  
             echo '<li><a href="index.php?c=index&m=lists&id='.$one['tid'].'">'.$one['typename'].'</a></li>';
             
           }
         ?>
      </ul>
      <form class="navbar-form navbar-left" role="search" action="search.html">
        <div class="form-group">
          <input type="text" class="form-control" placeholder="Search">
        </div>
        <button type="submit" class="btn btn-default">搜索</button>
      </form>

      <ul class="nav navbar-nav navbar-right">
        <li class="active">
        <a href="">欢迎 
        <?php
          session_start();
          if(isset($_SESSION["user"]))
            echo " ".$_SESSION["user"]." ";
          else
            echo "您";
        ?>
        访问本网站</a>
        </li>
      <?php
        //登录成功才显示
        if(isset($_SESSION["user"]))
        {
      ?>
      <?php
        require_once('system/dbConn.php');
        $user=$_SESSION["user"];
        $sql="select * from users where uname='$user'";
        $cha=mysql_query($sql);
        $row=mysql_fetch_assoc($cha);
        $uid=$row['uid'];
        $uname=$row['uname'];
        $birthdate=$row['birthdate'];
        $gender = $row['gender'];
        $hobby = $row['hobby'];
        //将数组转换成字符串
        $degree = $row['degree'];
        $intro = $row['intro'];
        $pic=$row['pic'];
        //var_dump($row);
      ?>
      <?php
       // require_once('head/head.php');
      ?>  



      <div class="modal fade" id="changeInfor" abindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
          <div class="modal-content">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal" aria-label="Close" onclick="location.replace('index.php')">
                <span aria-hidden="true">&times;</span>
              </button>
              <h4 class="modal-title" align="center" id="myModalLabel">请输入修改信息</h4>
            </div>
            <div class="modal-body">
              <p>
                <div class="container-fluid">
                 <form method="post" action="doChangeInfor.php" enctype="multipart/form-data" class="form-horizontal">
                    <input type="hidden" name="id"  value=<?php echo $uid;?>>
                 <div class="form-group">
                    <label for="exampleInputUserName1" class=" control-label col-sm-offset-2 col-md-2 ">姓名：</label>
                    <div class=" col-md-4 " >
                    <input type="text" name="uname" class="form-control " id="exampleInputUserName1" disabled value=<?php echo $uname; ?>>
                    </div>  
                  </div>
                  <div class="form-group">
                    <label class="col-md-2 col-sm-offset-2 control-label" >性别：</label>
                    <div class="col-md-4" >
                    <label class="radio-inline">
                    <input type="radio" name="gender" value="0" <?php  if(!$gender) echo 'checked'; ?>>男
                    </label>
                    <label class="radio-inline">
                    <input type="radio" name="gender" value="1" <?php  if($gender) echo 'checked'; ?>>女
                    </label>
                    </div>  
                  </div>
                  <div class="form-group">
                    <label for="exampleInputDate1" class="col-md-2 col-sm-offset-2 control-label" >生日：</label>
                    <div class="col-md-4" >
                    <input type="date" name="birthdate" class="form-control" id="exampleInputDate1" value=<?php echo $birthdate; ?>>
                    </div>  
                  </div> 
                 <div class="form-group">
                    <label class="col-md-2 col-sm-offset-2 control-label">爱好：</label>
                    <div class="col-md-4">
                    <label class="checkbox-inline">
                    <input type="checkbox" name="hobby[]" value="旅游" <?php if(strstr($hobby,'旅游')) echo 'checked'; ?>>旅游
                    </label>
                    <label class="checkbox-inline">
                    <input type="checkbox" name="hobby[]" value="登山" <?php if(strstr($hobby,'登山')) echo 'checked'; ?>>登山
                    </label>
                    <label class="checkbox-inline">
                    <input type="checkbox" name="hobby[]" value="健身" <?php if(strstr($hobby,'健身')) echo 'checked'; ?>>健身
                    </label>
                    <label class="checkbox-inline">
                    <input type="checkbox" name="hobby[]" value="上网" <?php if(strstr($hobby,'上网')) echo 'checked'; ?>>上网
                    </label>
                    <label class="checkbox-inline">
                    <input type="checkbox" name="hobby[]" value="游泳" <?php if(strstr($hobby,'游泳')) echo 'checked'; ?>>游泳
                    </label>
                    </div>  
                  </div> 
                  <div class="form-group">
                    <label class="col-md-2 col-sm-offset-2 control-label" >学历：</label>
                    <div class="col-md-4" >
                    <select class="form-control" name="degree">
                    <option value="0" >请选择</option>
                    <option value="1" <?php if ($degree=='1')  echo 'selected'; ?>>高中</option>
                    <option value="2" <?php if ($degree=='2')  echo 'selected'; ?>>大学</option>
                    <option value="3" <?php if ($degree=='3')  echo 'selected'; ?>>研究生</option>
                    <option value="4" <?php if ($degree=='4')  echo 'selected'; ?>>博士生</option>
                    </select>
                    </div>  
                  </div>
                  <div class="form-group">
                    <label for="exampleInputTextarea1" class="col-md-2 col-sm-offset-2 control-label">自我介绍：</label>
                    <div class="col-md-4" >
                    <textarea class="form-control" id="exampleInputTextarea1" name="intro" cols="40" rows="5"><?php echo $intro; ?></textarea>
                    </div>  
                  </div>
                  <div class="form-group">
                    <label for="exampleInputFile" class="col-md-2 col-sm-offset-2 control-label">头像：</label>
                    <div class="col-md-4" >
                    <input type="file" name="pic" id="exampleInputFile">原头像：<img src="./images/<?php  echo $pic; ?>" width="80px" height="80px" class="img-circle">
                    </div>  
                  </div>
                  <div class="form-group">
                    <div class="col-sm-offset-7 col-sm-4" >
                    <input type="submit" class="btn btn-default" value="更新">
                    </div>  
                  </div>
                </form>
                </div>
                <br>
              </p>
            </div>
          </div>
        </div>
      </div>

      <li><a href="logout.php">注销</a></li>
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
         aria-haspopup="true" aria-expanded="false">个人中心 <span class="caret"></span></a>
        <ul class="dropdown-menu">
          <li><a href="#" data-toggle="modal" data-target="#changeInfor">修改个人信息</a></li>
          <li><a href="myCommentList.php">我的评价</a></li>
          <li><a href="mybookList.php?<?php echo'id='.$uid.''; ?> ">我的书架</a></li>
        </ul>

      </li>

      <?php } else{ ?>

      <li><a href="#" data-toggle="modal" data-target="#login">登录</a></li>
      <li><a href="#" data-toggle="modal" data-target="#reg">注册</a></li>

      <div class="modal fade" id="login" tabindex="-1" role="dialog"
      aria-labelledby="myModalLabel">
      <div class="modal-dialog" role="document">
      <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"
        aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">请填写普通用户登录信息</h4>
      </div>
      <div class="modal-body">
      <form name="fm" method="post" action="doLogin.php" onsubmit="return check()"
      class="form-horizontal">
      <?php
      // show.php 页面传来的登录链接，需要带着 nid 参数，以便登陆成功后直接返回视频内容页
      ?>
      <input type="hidden" name="nid" id="novelid" >
      <div class="form-group">
        <label for="exampleInputUserName1" class="col-md-2 control-label">用户名</label>
        <div class="col-md-4">
          <input type="text" name="username" class="form-control" id="exampleInputUserName1"
          placeholder="姓名" required>
        </div>
        <div class="col-md-6"></div>
      </div>
      <div class="form-group">
        <label for="exampleInputPassword1" class="col-md-2 control-label">密码</label>
        <div class="col-md-4">
        <input type="password" name="pswd" class="form-control" id="exampleInputPassword1"
        placeholder="密码" required>
        </div><div class="col-md-6"></div>
      </div>
      <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
        <input type="submit" class="btn btn-default" value="登录">
        <input type="reset" class="btn btn-default" value="重置">
        </div>
      </div>

      <?php
      if(isset($_GET["msg"]))
      {
        echo'<h1 style="color:red;">'.$_GET["msg"]."</h1>";
      }
      ?>
      <?php
      if(isset($_GET["msg9"]))
      {
        echo'<h1 style="color:red;">'.$_GET["msg9"]."</h1>";
      }
      ?>

      </form>
      </div>

      <div class="modal-footer">
      <button type="button" class="btn btn-default" onclick="location.replace('index.php')"
      data-dismiss="modal">关闭</button>
      </div>

      </div>
      </div>
      </div>

      <div class="modal fade" id="reg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
            <h4 class="modal-title" id="myModalLabel">请填写用户注册信息</h4>
          </div>
          <div class="modal-body">

     <form method="post" action="doUserReg.php" enctype="multipart/form-data" class="form-horizontal">

      <div class="form-group">
      <label for="exampleInputUserName" class="col-md-2 control-label">姓名</label>
     <div class="col-md-10">
    <input type="text" name="uname" class="form-control" id="exampleInputUserName" placeholder="姓名" required="">
    </div>
    </div>

     <div class="form-group">
      <label for="exampleInputPassword" class="col-md-2 control-label">密码</label>
     <div class="col-md-10">
    <input type="password" name="password" class="form-control" id="exampleInputPassword" placeholder="密码" required="">
    </div>
    </div>
     
       <div class="form-group">
      <label class="col-md-2 control-label">性别</label>
        <div class="col-md-10">
        <label class="radio-inline">
      <input type="radio" name="gender" value="0" checked=""> 男
    </label>
    <label class="radio-inline">
      <input type="radio" name="gender" value="1"> 女
    </label>
       </div>
      </div>

    <div class="form-group">
      <label for="exampleInputBirth" class="col-md-2 control-label">生日</label>
     <div class="col-md-10">
    <input type="date" name="birthdate" class="form-control" id="exampleInputBirth" placeholder="生日" required="">
    </div>
    </div>
     
      <div class="form-group">
          <label class="col-md-2 control-label">爱好</label>
        <div class="col-md-10">
         <label class="checkbox-inline">
      <input type="checkbox" name="hobby[]" value="旅游"> 旅游
    </label>
    <label class="checkbox-inline">
      <input type="checkbox" name="hobby[]" value="登山"> 登山
    </label>
    <label class="checkbox-inline">
      <input type="checkbox" name="hobby[]" value="健身"> 健身
    </label>
    <label class="checkbox-inline">
      <input type="checkbox" name="hobby[]" value="上网"> 上网
    </label>
    <label class="checkbox-inline">
      <input type="checkbox" name="hobby[]" value="游泳"> 游泳
    </label>
        </div>
      </div>

    <div class="form-group">
    <label class="col-md-2 control-label">学历</label>
    <div class="col-md-10">
    <select class="form-control" name="degree">
      <option value="0">请选择</option>
        <option value="1">高中</option> 
        <option value="2">大学</option>
      <option value="3">研究生</option>  
      <option value="4">博士生</option>
    </select>
    </div>
      </div>

      <div class="form-group">
        <label for="exampleInputTextarea1" class="col-md-2 control-label">自我介绍</label>
        <div class="col-md-10">
      <textarea class="form-control" rows="3" id="exampleInputTextarea1" placeholder="自我简介：" name="intro"></textarea>
      </div>
      </div>

      <div class="form-group">
        <label for="exampleInputFile" class="col-md-2 control-label">头像</label>
        <div class="col-md-10">
      <input type="file" name="pic" id="exampleInputFile" required="">
        </div>
      </div>
      
      <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
          <input type="submit" class="btn btn-default" value="提交">
        <input type="reset" class="btn btn-default" value="重置">
        </div>
      </div>

     </form>
        
      
       </div>
          <div class="modal-footer">
                  <button type="button" class="btn btn-default" onclick="location.replace('index.php')" data-dismiss="modal">关闭</button>
          </div>
        </div>
      </div>
    </div>

      <?php } ?>
      </ul>   

      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>

<!-- /.navbar -->
<div class="container">
<!--幻灯片开始-->
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
    <!-- Indicators -->
    <ol class="carousel-indicators">
        <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
        <li data-target="#carousel-example-generic" data-slide-to="1"></li>
        <li data-target="#carousel-example-generic" data-slide-to="2"></li>
    </ol>

    <!-- Wrapper for slides -->
    <div class="carousel-inner">
        <div class="item active">
            <img src="assets/images/img4.jpg" class="img-responsive" alt="image 1">
            <div class="carousel-caption">
            </div>
        </div>
        <div class="item">
            <img src="assets/images/img2.jpg" class="img-responsive" alt="image 2">
            <div class="carousel-caption">
            </div>
        </div>
        <div class="item">
            <img src="assets/images/img3.jpg" class="img-responsive" alt="image 3">
            <div class="carousel-caption">
            </div>
        </div>
    </div>

    <!-- Controls -->
    <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
        <span class="glyphicon glyphicon-chevron-left"></span>
    </a>
    <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
        <span class="glyphicon glyphicon-chevron-right"></span>
    </a>
</div>
<!--幻灯片结束-->



    <div class="row row-offcanvas row-offcanvas-right">
        <div class="col-xs-12 col-sm-9">
            <div class="row text-center">
            <?php  
                foreach ($f_list as $ft){
            ?>
            <div class="col-xs-12 col-lg-12 mlist">
                <h2><?php echo $ft['typename'];?></h2>
                    <ul class="list-inline row text-center">
                        <?php 
                            foreach ($ft['list'] as $one)
                            {
                                echo '<li class="col-xs-6 col-lg-2">
                                    <img src="images/'.$one['pic'].'" class="responsive img-thumbnail"/>
                                    <p><a href="index.php?c=index&m=show&id='.$one['nid'].'">'.$one['novelname'].'</a></p>
                                      </li>';
                            }
                        ?>
                    </ul>
                    <p><a class="btn btn-default" href="index.php?c=index&m=lists&id=<?php echo $ft['tid']; ?>" role="button">更多 &raquo;</a></p>

            </div>
            <?php
                }
            ?>
            <!-- <div class="col-xs-12 col-lg-12 mlist">
                <h2>栏目名称</h2>
                <ul class="list-inline row text-center">
                    <li class="col-xs-4 col-sm-3 col-lg-2">
                        <img src="assets/images/img1.jpg" class="responsive img-thumbnail"/>

                        <p><a href="show.html">视频标题</a>
                        </p>
                    </li>
                    <li class="col-xs-4 col-sm-3 col-lg-2">
                        <img src="assets/images/img1.jpg" class="responsive img-thumbnail"/>

                        <p><a href="show.html">视频标题</a>
                        </p>
                    </li>

                </ul>
                <p><a class="btn btn-default" href="list.html" role="button">更多 &raquo;</a></p>
            </div> -->
            <!--/.col-xs-6.col-lg-4-->

            </div>
            <!--/row-->
        </div>
        <!--/.col-xs-12.col-sm-9-->

        <div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar">
            <div class="list-group text-center">
                <h2 style="color:white;" >排行</h2>
                <ul class="list-inline row text-center">
                    <?php 
                        foreach ($hits_list as $one)
                        {
                            echo '<li class="col-xs-12 col-lg-6">
                                    <img src="images/'.$one['pic'].'" class="responsive img-thumbnail"/>
                                    <p><a href="index.php?c=index&m=show&id='.$one['nid'].'">'.$one['novelname'].'</a>
                                    </p>
                                  </li>';
                        }
                     ?>
        <!-- <li class="col-xs-12 col-lg-6">
            <img src="assets/images/img1.jpg" class="responsive img-thumbnail"/>

            <p><a href="show.html">视频标题</a>
            </p>
        </li>
        <li class="col-xs-12 col-lg-6">
            <img src="assets/images/img1.jpg" class="responsive img-thumbnail"/>

            <p><a href="show.html">视频标题</a>
            </p>
        </li> -->
                </ul>
            </div>
        </div>
        <!--/.sidebar-offcanvas-->
    </div>
    <!--/row-->

   

</div>
<!--/.container-->
 <hr>

    <footer>
        <p>&copy; 版权所有 2016 赵庆阳 李鹏 于兴宇</p>

    </footer>

<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>

<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="assets/js/ie10-viewport-bug-workaround.js"></script>

<script src="offcanvas.js"></script>
<script>
    $('.carousel').carousel({
        interval: 3000 //changes the speed
    })
</script>
</body>
<p class= 'text-center'><a href="admin.php">管理员登录</a></p>
</html>